\(\int \cot ^6(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx\) [1251]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 158 \[ \int \cot ^6(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-b^2 x+\frac {5 a b \text {arctanh}(\cos (c+d x))}{8 d}-\frac {b^2 \cot (c+d x)}{d}+\frac {b^2 \cot ^3(c+d x)}{3 d}-\frac {b^2 \cot ^5(c+d x)}{5 d}-\frac {a^2 \cot ^7(c+d x)}{7 d}-\frac {5 a b \cot (c+d x) \csc (c+d x)}{8 d}+\frac {5 a b \cot ^3(c+d x) \csc (c+d x)}{12 d}-\frac {a b \cot ^5(c+d x) \csc (c+d x)}{3 d} \]

[Out]

-b^2*x+5/8*a*b*arctanh(cos(d*x+c))/d-b^2*cot(d*x+c)/d+1/3*b^2*cot(d*x+c)^3/d-1/5*b^2*cot(d*x+c)^5/d-1/7*a^2*co
t(d*x+c)^7/d-5/8*a*b*cot(d*x+c)*csc(d*x+c)/d+5/12*a*b*cot(d*x+c)^3*csc(d*x+c)/d-1/3*a*b*cot(d*x+c)^5*csc(d*x+c
)/d

Rubi [A] (verified)

Time = 0.51 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {2990, 2691, 3855, 14, 209} \[ \int \cot ^6(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {a^2 \cot ^7(c+d x)}{7 d}+\frac {5 a b \text {arctanh}(\cos (c+d x))}{8 d}-\frac {a b \cot ^5(c+d x) \csc (c+d x)}{3 d}+\frac {5 a b \cot ^3(c+d x) \csc (c+d x)}{12 d}-\frac {5 a b \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b^2 \cot ^5(c+d x)}{5 d}+\frac {b^2 \cot ^3(c+d x)}{3 d}-\frac {b^2 \cot (c+d x)}{d}-b^2 x \]

[In]

Int[Cot[c + d*x]^6*Csc[c + d*x]^2*(a + b*Sin[c + d*x])^2,x]

[Out]

-(b^2*x) + (5*a*b*ArcTanh[Cos[c + d*x]])/(8*d) - (b^2*Cot[c + d*x])/d + (b^2*Cot[c + d*x]^3)/(3*d) - (b^2*Cot[
c + d*x]^5)/(5*d) - (a^2*Cot[c + d*x]^7)/(7*d) - (5*a*b*Cot[c + d*x]*Csc[c + d*x])/(8*d) + (5*a*b*Cot[c + d*x]
^3*Csc[c + d*x])/(12*d) - (a*b*Cot[c + d*x]^5*Csc[c + d*x])/(3*d)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2990

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*
(x_)])^2, x_Symbol] :> Dist[2*a*(b/d), Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^(n + 1), x], x] + Int[(g*Cos[e
+ f*x])^p*(d*Sin[e + f*x])^n*(a^2 + b^2*Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && NeQ[a^2 -
 b^2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = (2 a b) \int \cot ^6(c+d x) \csc (c+d x) \, dx+\int \cot ^6(c+d x) \csc ^2(c+d x) \left (a^2+b^2 \sin ^2(c+d x)\right ) \, dx \\ & = -\frac {a b \cot ^5(c+d x) \csc (c+d x)}{3 d}-\frac {1}{3} (5 a b) \int \cot ^4(c+d x) \csc (c+d x) \, dx+\frac {\text {Subst}\left (\int \frac {a^2+\frac {b^2 x^2}{1+x^2}}{x^8} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {5 a b \cot ^3(c+d x) \csc (c+d x)}{12 d}-\frac {a b \cot ^5(c+d x) \csc (c+d x)}{3 d}+\frac {1}{4} (5 a b) \int \cot ^2(c+d x) \csc (c+d x) \, dx+\frac {\text {Subst}\left (\int \left (\frac {a^2}{x^8}+\frac {b^2}{x^6}-\frac {b^2}{x^4}+\frac {b^2}{x^2}-\frac {b^2}{1+x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = -\frac {b^2 \cot (c+d x)}{d}+\frac {b^2 \cot ^3(c+d x)}{3 d}-\frac {b^2 \cot ^5(c+d x)}{5 d}-\frac {a^2 \cot ^7(c+d x)}{7 d}-\frac {5 a b \cot (c+d x) \csc (c+d x)}{8 d}+\frac {5 a b \cot ^3(c+d x) \csc (c+d x)}{12 d}-\frac {a b \cot ^5(c+d x) \csc (c+d x)}{3 d}-\frac {1}{8} (5 a b) \int \csc (c+d x) \, dx-\frac {b^2 \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{d} \\ & = -b^2 x+\frac {5 a b \text {arctanh}(\cos (c+d x))}{8 d}-\frac {b^2 \cot (c+d x)}{d}+\frac {b^2 \cot ^3(c+d x)}{3 d}-\frac {b^2 \cot ^5(c+d x)}{5 d}-\frac {a^2 \cot ^7(c+d x)}{7 d}-\frac {5 a b \cot (c+d x) \csc (c+d x)}{8 d}+\frac {5 a b \cot ^3(c+d x) \csc (c+d x)}{12 d}-\frac {a b \cot ^5(c+d x) \csc (c+d x)}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.67 (sec) , antiderivative size = 280, normalized size of antiderivative = 1.77 \[ \int \cot ^6(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {-14700 b^2 (c+d x) \csc ^6(c+d x)+16800 a b \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-350 \cot (c+d x) \csc ^6(c+d x) \left (6 \left (a^2+b^2\right )+17 a b \sin (c+d x)\right )+\csc ^7(c+d x) \left (-84 \left (15 a^2-41 b^2\right ) \cos (3 (c+d x))-28 \left (15 a^2+71 b^2\right ) \cos (5 (c+d x))-60 a^2 \cos (7 (c+d x))+644 b^2 \cos (7 (c+d x))+8820 b^2 c \sin (3 (c+d x))+8820 b^2 d x \sin (3 (c+d x))+980 a b \sin (4 (c+d x))-2940 b^2 c \sin (5 (c+d x))-2940 b^2 d x \sin (5 (c+d x))-1155 a b \sin (6 (c+d x))+420 b^2 c \sin (7 (c+d x))+420 b^2 d x \sin (7 (c+d x))\right )}{26880 d} \]

[In]

Integrate[Cot[c + d*x]^6*Csc[c + d*x]^2*(a + b*Sin[c + d*x])^2,x]

[Out]

(-14700*b^2*(c + d*x)*Csc[c + d*x]^6 + 16800*a*b*(Log[Cos[(c + d*x)/2]] - Log[Sin[(c + d*x)/2]]) - 350*Cot[c +
 d*x]*Csc[c + d*x]^6*(6*(a^2 + b^2) + 17*a*b*Sin[c + d*x]) + Csc[c + d*x]^7*(-84*(15*a^2 - 41*b^2)*Cos[3*(c +
d*x)] - 28*(15*a^2 + 71*b^2)*Cos[5*(c + d*x)] - 60*a^2*Cos[7*(c + d*x)] + 644*b^2*Cos[7*(c + d*x)] + 8820*b^2*
c*Sin[3*(c + d*x)] + 8820*b^2*d*x*Sin[3*(c + d*x)] + 980*a*b*Sin[4*(c + d*x)] - 2940*b^2*c*Sin[5*(c + d*x)] -
2940*b^2*d*x*Sin[5*(c + d*x)] - 1155*a*b*Sin[6*(c + d*x)] + 420*b^2*c*Sin[7*(c + d*x)] + 420*b^2*d*x*Sin[7*(c
+ d*x)]))/(26880*d)

Maple [A] (verified)

Time = 0.52 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.09

method result size
derivativedivides \(\frac {-\frac {a^{2} \left (\cos ^{7}\left (d x +c \right )\right )}{7 \sin \left (d x +c \right )^{7}}+2 a b \left (-\frac {\cos ^{7}\left (d x +c \right )}{6 \sin \left (d x +c \right )^{6}}+\frac {\cos ^{7}\left (d x +c \right )}{24 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{7}\left (d x +c \right )}{16 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{5}\left (d x +c \right )\right )}{16}-\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{48}-\frac {5 \cos \left (d x +c \right )}{16}-\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{16}\right )+b^{2} \left (-\frac {\left (\cot ^{5}\left (d x +c \right )\right )}{5}+\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}-\cot \left (d x +c \right )-d x -c \right )}{d}\) \(172\)
default \(\frac {-\frac {a^{2} \left (\cos ^{7}\left (d x +c \right )\right )}{7 \sin \left (d x +c \right )^{7}}+2 a b \left (-\frac {\cos ^{7}\left (d x +c \right )}{6 \sin \left (d x +c \right )^{6}}+\frac {\cos ^{7}\left (d x +c \right )}{24 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{7}\left (d x +c \right )}{16 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{5}\left (d x +c \right )\right )}{16}-\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{48}-\frac {5 \cos \left (d x +c \right )}{16}-\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{16}\right )+b^{2} \left (-\frac {\left (\cot ^{5}\left (d x +c \right )\right )}{5}+\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}-\cot \left (d x +c \right )-d x -c \right )}{d}\) \(172\)
risch \(-b^{2} x +\frac {2520 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+840 i a^{2} {\mathrm e}^{12 i \left (d x +c \right )}+1155 a b \,{\mathrm e}^{13 i \left (d x +c \right )}+120 i a^{2}-980 a b \,{\mathrm e}^{11 i \left (d x +c \right )}-2520 i b^{2} {\mathrm e}^{12 i \left (d x +c \right )}+4200 i a^{2} {\mathrm e}^{8 i \left (d x +c \right )}+2975 a b \,{\mathrm e}^{9 i \left (d x +c \right )}+6496 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-1288 i b^{2}-20440 i b^{2} {\mathrm e}^{8 i \left (d x +c \right )}-2975 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+10080 i b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+980 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-16968 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+24640 i b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-1155 a b \,{\mathrm e}^{i \left (d x +c \right )}}{420 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{7}}+\frac {5 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}-\frac {5 a b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}\) \(290\)
parallelrisch \(\frac {-15 a^{2} \left (\cot ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+15 a^{2} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-70 a b \left (\cot ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+70 \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b +105 a^{2} \left (\cot ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-84 b^{2} \left (\cot ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-105 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}+84 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}+630 a b \left (\cot ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-630 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -315 a^{2} \left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+980 b^{2} \left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+315 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}-980 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}-3150 a b \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3150 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b -13440 b^{2} d x +525 a^{2} \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-9240 b^{2} \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-525 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2}+9240 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{2}-8400 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a b}{13440 d}\) \(334\)

[In]

int(cos(d*x+c)^6*csc(d*x+c)^8*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/7*a^2/sin(d*x+c)^7*cos(d*x+c)^7+2*a*b*(-1/6/sin(d*x+c)^6*cos(d*x+c)^7+1/24/sin(d*x+c)^4*cos(d*x+c)^7-1
/16/sin(d*x+c)^2*cos(d*x+c)^7-1/16*cos(d*x+c)^5-5/48*cos(d*x+c)^3-5/16*cos(d*x+c)-5/16*ln(csc(d*x+c)-cot(d*x+c
)))+b^2*(-1/5*cot(d*x+c)^5+1/3*cot(d*x+c)^3-cot(d*x+c)-d*x-c))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 320 vs. \(2 (144) = 288\).

Time = 0.38 (sec) , antiderivative size = 320, normalized size of antiderivative = 2.03 \[ \int \cot ^6(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {16 \, {\left (15 \, a^{2} - 161 \, b^{2}\right )} \cos \left (d x + c\right )^{7} + 6496 \, b^{2} \cos \left (d x + c\right )^{5} - 5600 \, b^{2} \cos \left (d x + c\right )^{3} + 1680 \, b^{2} \cos \left (d x + c\right ) + 525 \, {\left (a b \cos \left (d x + c\right )^{6} - 3 \, a b \cos \left (d x + c\right )^{4} + 3 \, a b \cos \left (d x + c\right )^{2} - a b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 525 \, {\left (a b \cos \left (d x + c\right )^{6} - 3 \, a b \cos \left (d x + c\right )^{4} + 3 \, a b \cos \left (d x + c\right )^{2} - a b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 70 \, {\left (24 \, b^{2} d x \cos \left (d x + c\right )^{6} - 72 \, b^{2} d x \cos \left (d x + c\right )^{4} - 33 \, a b \cos \left (d x + c\right )^{5} + 72 \, b^{2} d x \cos \left (d x + c\right )^{2} + 40 \, a b \cos \left (d x + c\right )^{3} - 24 \, b^{2} d x - 15 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{1680 \, {\left (d \cos \left (d x + c\right )^{6} - 3 \, d \cos \left (d x + c\right )^{4} + 3 \, d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^8*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/1680*(16*(15*a^2 - 161*b^2)*cos(d*x + c)^7 + 6496*b^2*cos(d*x + c)^5 - 5600*b^2*cos(d*x + c)^3 + 1680*b^2*co
s(d*x + c) + 525*(a*b*cos(d*x + c)^6 - 3*a*b*cos(d*x + c)^4 + 3*a*b*cos(d*x + c)^2 - a*b)*log(1/2*cos(d*x + c)
 + 1/2)*sin(d*x + c) - 525*(a*b*cos(d*x + c)^6 - 3*a*b*cos(d*x + c)^4 + 3*a*b*cos(d*x + c)^2 - a*b)*log(-1/2*c
os(d*x + c) + 1/2)*sin(d*x + c) - 70*(24*b^2*d*x*cos(d*x + c)^6 - 72*b^2*d*x*cos(d*x + c)^4 - 33*a*b*cos(d*x +
 c)^5 + 72*b^2*d*x*cos(d*x + c)^2 + 40*a*b*cos(d*x + c)^3 - 24*b^2*d*x - 15*a*b*cos(d*x + c))*sin(d*x + c))/((
d*cos(d*x + c)^6 - 3*d*cos(d*x + c)^4 + 3*d*cos(d*x + c)^2 - d)*sin(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \cot ^6(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**6*csc(d*x+c)**8*(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 153, normalized size of antiderivative = 0.97 \[ \int \cot ^6(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {112 \, {\left (15 \, d x + 15 \, c + \frac {15 \, \tan \left (d x + c\right )^{4} - 5 \, \tan \left (d x + c\right )^{2} + 3}{\tan \left (d x + c\right )^{5}}\right )} b^{2} - 35 \, a b {\left (\frac {2 \, {\left (33 \, \cos \left (d x + c\right )^{5} - 40 \, \cos \left (d x + c\right )^{3} + 15 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{6} - 3 \, \cos \left (d x + c\right )^{4} + 3 \, \cos \left (d x + c\right )^{2} - 1} + 15 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 15 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {240 \, a^{2}}{\tan \left (d x + c\right )^{7}}}{1680 \, d} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^8*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/1680*(112*(15*d*x + 15*c + (15*tan(d*x + c)^4 - 5*tan(d*x + c)^2 + 3)/tan(d*x + c)^5)*b^2 - 35*a*b*(2*(33*c
os(d*x + c)^5 - 40*cos(d*x + c)^3 + 15*cos(d*x + c))/(cos(d*x + c)^6 - 3*cos(d*x + c)^4 + 3*cos(d*x + c)^2 - 1
) + 15*log(cos(d*x + c) + 1) - 15*log(cos(d*x + c) - 1)) + 240*a^2/tan(d*x + c)^7)/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 356 vs. \(2 (144) = 288\).

Time = 0.42 (sec) , antiderivative size = 356, normalized size of antiderivative = 2.25 \[ \int \cot ^6(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 70 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 105 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 84 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 630 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 315 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 980 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3150 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 13440 \, {\left (d x + c\right )} b^{2} - 8400 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 525 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 9240 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {21780 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 525 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 9240 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 3150 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 315 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 980 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 630 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 105 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 84 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 70 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7}}}{13440 \, d} \]

[In]

integrate(cos(d*x+c)^6*csc(d*x+c)^8*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/13440*(15*a^2*tan(1/2*d*x + 1/2*c)^7 + 70*a*b*tan(1/2*d*x + 1/2*c)^6 - 105*a^2*tan(1/2*d*x + 1/2*c)^5 + 84*b
^2*tan(1/2*d*x + 1/2*c)^5 - 630*a*b*tan(1/2*d*x + 1/2*c)^4 + 315*a^2*tan(1/2*d*x + 1/2*c)^3 - 980*b^2*tan(1/2*
d*x + 1/2*c)^3 + 3150*a*b*tan(1/2*d*x + 1/2*c)^2 - 13440*(d*x + c)*b^2 - 8400*a*b*log(abs(tan(1/2*d*x + 1/2*c)
)) - 525*a^2*tan(1/2*d*x + 1/2*c) + 9240*b^2*tan(1/2*d*x + 1/2*c) + (21780*a*b*tan(1/2*d*x + 1/2*c)^7 + 525*a^
2*tan(1/2*d*x + 1/2*c)^6 - 9240*b^2*tan(1/2*d*x + 1/2*c)^6 - 3150*a*b*tan(1/2*d*x + 1/2*c)^5 - 315*a^2*tan(1/2
*d*x + 1/2*c)^4 + 980*b^2*tan(1/2*d*x + 1/2*c)^4 + 630*a*b*tan(1/2*d*x + 1/2*c)^3 + 105*a^2*tan(1/2*d*x + 1/2*
c)^2 - 84*b^2*tan(1/2*d*x + 1/2*c)^2 - 70*a*b*tan(1/2*d*x + 1/2*c) - 15*a^2)/tan(1/2*d*x + 1/2*c)^7)/d

Mupad [B] (verification not implemented)

Time = 11.54 (sec) , antiderivative size = 379, normalized size of antiderivative = 2.40 \[ \int \cot ^6(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{896\,d}-\frac {2\,b^2\,\mathrm {atan}\left (\frac {4\,b^4}{\frac {5\,a\,b^3}{2}-4\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {5\,a\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,\left (\frac {5\,a\,b^3}{2}-4\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}\right )}{d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {5\,a^2}{128}-\frac {11\,b^2}{16}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (3\,a^2-\frac {28\,b^2}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (5\,a^2-88\,b^2\right )+\frac {a^2}{7}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (a^2-\frac {4\,b^2}{5}\right )-6\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+30\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {2\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}}{128\,d\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {3\,a^2}{128}-\frac {7\,b^2}{96}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {a^2}{128}-\frac {b^2}{160}\right )}{d}+\frac {15\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{64\,d}-\frac {3\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{192\,d}-\frac {5\,a\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{8\,d} \]

[In]

int((cos(c + d*x)^6*(a + b*sin(c + d*x))^2)/sin(c + d*x)^8,x)

[Out]

(a^2*tan(c/2 + (d*x)/2)^7)/(896*d) - (2*b^2*atan((4*b^4)/((5*a*b^3)/2 - 4*b^4*tan(c/2 + (d*x)/2)) + (5*a*b^3*t
an(c/2 + (d*x)/2))/(2*((5*a*b^3)/2 - 4*b^4*tan(c/2 + (d*x)/2)))))/d - (tan(c/2 + (d*x)/2)*((5*a^2)/128 - (11*b
^2)/16))/d - (tan(c/2 + (d*x)/2)^4*(3*a^2 - (28*b^2)/3) - tan(c/2 + (d*x)/2)^6*(5*a^2 - 88*b^2) + a^2/7 - tan(
c/2 + (d*x)/2)^2*(a^2 - (4*b^2)/5) - 6*a*b*tan(c/2 + (d*x)/2)^3 + 30*a*b*tan(c/2 + (d*x)/2)^5 + (2*a*b*tan(c/2
 + (d*x)/2))/3)/(128*d*tan(c/2 + (d*x)/2)^7) + (tan(c/2 + (d*x)/2)^3*((3*a^2)/128 - (7*b^2)/96))/d - (tan(c/2
+ (d*x)/2)^5*(a^2/128 - b^2/160))/d + (15*a*b*tan(c/2 + (d*x)/2)^2)/(64*d) - (3*a*b*tan(c/2 + (d*x)/2)^4)/(64*
d) + (a*b*tan(c/2 + (d*x)/2)^6)/(192*d) - (5*a*b*log(tan(c/2 + (d*x)/2)))/(8*d)